/* USER CODE BEGIN Header */
/**
  ******************************************************************************
  * @file    usart.h
  * @brief   This file contains all the function prototypes for
  *          the usart.c file
  ******************************************************************************
  * @attention
  *
  * Copyright (c) 2024 STMicroelectronics.
  * All rights reserved.
  *
  * This software is licensed under terms that can be found in the LICENSE file
  * in the root directory of this software component.
  * If no LICENSE file comes with this software, it is provided AS-IS.
  *
  ******************************************************************************
  */
/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __USART_H__
#define __USART_H__

#ifdef __cplusplus
extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include "main.h"

/* USER CODE BEGIN Includes */

/* USER CODE END Includes */

extern UART_HandleTypeDef huart1;

extern UART_HandleTypeDef huart2;

/* USER CODE BEGIN Private defines */
//数组大小
#define UART_TX_BUFFER_LEN 128
#define UART_RX_BUFFER_LEN 128
//接收缓冲�??
extern uint8_t Uart1_Rx_Buffer[2][UART_RX_BUFFER_LEN];   //接收缓冲区（双缓冲）
extern uint8_t Uart2_Rx_Buffer[2][UART_RX_BUFFER_LEN];
//接收指针
extern uint8_t *Uart1_Rx_Ptr;
extern uint8_t *Uart2_Rx_Ptr;
//发�?�缓冲区
extern uint8_t Uart1_Tx_Buffer[UART_TX_BUFFER_LEN];
extern uint8_t Uart2_Tx_Buffer[UART_TX_BUFFER_LEN];
//发�?�指�??
extern uint8_t *Uart1_Tx_Ptr;
extern uint8_t *Uart2_Tx_Ptr;

extern uint8_t *Uart_Debug_Tx_Ptr;
extern void (*Uart_Debug_Send)(uint8_t*,uint16_t);//串口发�?�函数指�??
/* USER CODE END Private defines */

void MX_USART1_UART_Init(void);
void MX_USART2_UART_Init(void);

/* USER CODE BEGIN Prototypes */
void Uart1_Send(uint8_t* _data,uint16_t _len);
void Uart2_Send(uint8_t* _data,uint16_t _len);
/* USER CODE END Prototypes */

#ifdef __cplusplus
}
#endif

#endif /* __USART_H__ */

